home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / fish / 726-750 / 737 / dbuff / dbuff.doc < prev    next >
Text File  |  1995-03-18  |  4KB  |  102 lines

  1.  
  2.    DBuff V1.3
  3.    ==========
  4.    
  5.    This version is an update to DBuff on Fish 599. To be honest, that
  6.    version didn't work at all! Somehow, an old developmental version
  7.    got out instead of the current version at the time. Apologies to
  8.    anyone who found problems with it and my thanks to Thom (sorry,
  9.    I've forgotten your surname!) who pointed out that it didn't work!
  10.  
  11.    This program is not in the public domain, but it may be freely copied
  12.    and distributed for no charge providing this header is included.
  13.    The code may be modified as required, but any modifications must be
  14.    documented so that the person responsible can be identified. If someone
  15.    else breaks this code, I don't want to be blamed for code that does not
  16.    work! The code may not be sold commercially without prior permission from
  17.    the author, although it may be given away free with commercial products,
  18.    providing it is made clear that this program is free and that the source
  19.    code is provided with the program.
  20.  
  21. ****************************************************************************
  22.  
  23.    Description:
  24.    ============
  25.    These routines set up, manipulate and tidy up for double buffered
  26.    animation using an Intuition Screen and Window
  27.  
  28. ****************************************************************************
  29.  
  30.    Usage:
  31.    ======
  32.  
  33.    5 routines are supplied:
  34.  
  35. >  RastPort = (struct RastPort *)InitDBuff(GfxBase,Screen,depth,Window)
  36.    --------------------------------------------------------------------
  37.    Given the GfxBase, Screen and Window, this routine returns the
  38.    second RastPort
  39.  
  40.  
  41. >  SetView1()
  42.    ----------
  43. >  SetView2()
  44.    ----------
  45.    Sets the required view ready for drawing. SetView1() sets the Intuition
  46.    view, SetView2() sets the alternate view.
  47.    
  48.  
  49. >  SwapView()
  50.    ----------
  51.    Displays the new view (after drawing)
  52.    
  53.  
  54. >  FreeDBuff(screen,depth,RastPort)
  55.    --------------------------------
  56.    Frees up the memory, etc. for the second view.
  57.  
  58.  
  59.  
  60. ****************************************************************************
  61.  
  62.    How to use:
  63.    ===========
  64.  
  65.    1. Declare a Screen pointer, Window pointer and RastPort pointer as
  66.       normal.
  67.    2. Declare a second RastPort pointer.
  68.    3. Open an Intuition screen as normal with a full size NOBORDER window.
  69.    4. Set the first RastPort to the Intuition RastPort:
  70.       rport1 = window->RPort
  71.    5. Set the second RastPort using a call to InitDBuff():
  72.       rport2 = (struct RastPort *)InitDBuff(GfxBase,screen,DEPTH,window);
  73.    6. Make sure we've got the Intuition view by calling SetView1();
  74.    7. Draw into the *second* RastPort, rport2.
  75.    8. Call SwapView() to get this RastPort displayed.
  76.    9. Make sure we've got the second view by calling SetView2();
  77.   10. Draw into the *first* RastPort, rport1.
  78.   11. Call SwapView() to get this RastPort displayed.
  79.   12. If not finished, go to 6.
  80.   13. Free the second ViewPort, etc. by calling:
  81.       FreeDBuff(screen,DEPTH,rport2);
  82.  
  83.  
  84. ****************************************************************************
  85.  
  86.    Notes:
  87.    ======
  88.  
  89.    1. Assumes both graphics and intuition libraries are open
  90.    2. The window should be NOBORDER and have a null title
  91.    3. For maximum speed in swapping views, the SwapView() call could
  92.       be replaced by the following code.
  93.       Put this up the top somewhere:
  94.          #include <graphics/gfxbase.h>
  95.          struct View *DB_view;
  96.          DB_view = GfxBase->ActiView;
  97.       Replace exch SwapView() call with:
  98.          MrgCpr(DB_view);
  99.    4. #define DEMO to see the demonstration.
  100.  
  101.  
  102.